// pages/other/index.js
var { getLoginedUser, fnLoading, fnHideLoading, fnSuccess, fnFail } = require('../../utils/index')
import { domainStatic } from '../../utils/env.js';
import _ from '../../utils/underscore.js';

import { get, fnChoose, lsGetStr, fnUpload, post } from '../../utils/request.js';
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    title:[]
  },
  required: function (e) {
    wx.navigateTo({
      url: '../../pages/DetailPags/index?id=' + e.currentTarget.dataset.id,
    })
  },
  login: function () {
    let that = this;
    for (var item of that.data.title) {
      console.log(item.remark);
      that.setData({
        remark: item.remark
      })
    }
    // wx.navigateTo({
    //   url: '../login/index?src=' + that.data.remark,
    // })
  },
  know: function (e) {
    if (e.currentTarget.dataset.id == '14229') {
      var typeId = '980'

    } else {
      var typeId = '981'
    }
    wx.navigateTo({
      url: '../../pages/DetailPags/index?id=' + typeId,

    })
  },
image:function(e){
  var id = e.target.dataset.id;
console.log(id);
wx.navigateTo({
  url: '../../pages/urgent/index?type=' + id,
})
},
  // required: function () {
  //   wx.navigateTo({
  //     url: '../../pages/required/index',
  //   })
  // },
  // problem: function () {
  //   wx.navigateTo({
  //     url: '../../pages/problem/index',
  //   })
  // },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that = this;
    wx.showShareMenu();//
    wx.hideTabBar();
    app.customTabBar()
    // Promise.all([
    //   get({
    //     path: '/category1/list?type1=330&isShow=1&sortField=order_num&sortOrder=ASC'
    //   }),
    // ])
    //   .then(function (res) {
    //     that.setData({
    //       other: _.sortBy(res[0].slice(1, 3), 'id'),
    //     })
    //   })
    //   .catch(function (res) {
    //     fnLoading("请求失败")
    //   })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})